<template>

  <div style="background-image: url(../../../static/eeg.jpg);width: 100%;height: 600px">


    <div style="width: 50%;margin-top: 5%;margin-left: 20%;float: left">
      <el-form
        :model="dataForm"
        :rules="dataRule"
        ref="dataForm"
        @keyup.enter.native="dataFormSubmit()"
        label-width="140px"
      >
        <el-form-item label="姓名" prop="userName" >
          <el-input v-model="dataForm.userName"></el-input>
        </el-form-item>
        <el-form-item label="登入用户名" prop="userNum">
          <el-input v-model="dataForm.userNum"></el-input>
        </el-form-item>
        <el-form-item label="电话" prop="userPhone">
          <el-input v-model="dataForm.userPhone"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="userPwd">
          <el-input v-model="dataForm.userPwd"></el-input>
        </el-form-item>
        <el-form-item label="邮箱" prop="userEmail">
          <el-input v-model="dataForm.userEmail"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer" style="margin-left: 40%">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">提交</el-button>
    </span>
    </div>
  </div>


</template>
<script>
import user from '@/api/user'
import md5 from 'js-md5';

export default {
  data() {
    return {
      dataForm: {},
      dataRule:{}
    }


  },
  created() {
    console.log("==================================")
    this.test();
  },
  methods:{

    test()
    {
      console.log(md5('holle'))

    },
    dataFormSubmit(){

      user.user(this.dataForm).then((response)=>{
        if (response.code  === '000000') {
          this.$message({
            message: "提交成功",
            type: "success",
            duration: 700,
            onClose: () => {
            }
          });
        } else {
          //this.$message.error(data.msg);
        }
      })


    }


  }
}

</script>
<style>


</style>
